package com.leo.boot.web.controller;

import com.leo.boot.web.exception.BusinessException;
import com.leo.boot.web.vo.ResultStatus;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "异常测试")
@RestController(value = "/exception")
public class ExceptionController {

    @GetMapping("/runtime")
    public String runtimeException() {
        throw new RuntimeException();
    }

    @GetMapping("/business")
    public String businessException() {
        throw new BusinessException(ResultStatus.BAD_REQUEST, "error");
    }
}